import request from "@/utils/request";

const sendChatMessage = (message) => {
    return request({
        url: `/api/ai/chat`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'  // 明确指定Content-Type
        },
        data: {
            message: message
        }
    });
}

const createTravelPlanTask = (message) => {
    return request({
        url: `/api/ai/create-task`,
        method: 'post',
        headers: {
            'Content-Type': 'application/json'  // 明确指定Content-Type
        },
        data: {
            message: message
        }
    });
}

const checkTravelPlanStatus = (taskId) => {
    return request({
        url: `/api/ai/check-task/${taskId}`,
        method: 'get',

    });
}

export { sendChatMessage, createTravelPlanTask, checkTravelPlanStatus  };